﻿require.config({
  urlArgs: "version=20170501",
  paths: {
    'jquery': '../packages/jquery-2.14-min',
    'bootstrap': '../../bootstrap/js/bootstrap.min',
  },
  shim: {
    'bootstrap': {
      deps: ['jquery'],
      exports: 'bootstrap'
    }
  }
});




require(['jquery','bootstrap'], function ($) {

	var myChart = echarts.init(document.getElementById('content-right-classify1'));
  $('#graph-5001').click(function () {
	drawGraph_5001();
	  $('#graph-show').modal('show');
  });
  
  $('#graph-5002').click(function () {
	drawGraph_5002();
 	 $('#graph-show').modal('show');
  });
  
  $('#graph-5003').click(function () {
  	drawGraph_5003();
	  $('#graph-show').modal('show');
  });

  $('#graph-5004').click(function () {
  	drawGraph_5004();
	  $('#graph-show').modal('show');
  });

  $('#graph-5005').click(function () {
  	drawGraph_5005();
	  $('#graph-show').modal('show');
  });  

  $('#graph-5006').click(function () {
  	drawGraph_5006();
	  $('#graph-show').modal('show');
  });
  
  $('#graph-5007').click(function () {
  	drawGraph_5007();
	  $('#graph-show').modal('show');
  });
  
  $('#graph-5008').click(function () {
  	drawGraph_5008();
	  $('#graph-show').modal('show');
  });
  
  $('#graph-5009').click(function () {
  	drawGraph_5009();
	  $('#graph-show').modal('show');
  });
  
  $('#graph-5010').click(function () {
  	drawGraph_5010();
	  $('#graph-show').modal('show');
  });
  
  $('#graph-5011').click(function () {
  	drawGraph_5011();
	  $('#graph-show').modal('show');
  });
  
  $('#graph-5012').click(function () {
  	drawGraph_5012();
	  $('#graph-show').modal('show');
  });
    
	function drawGraph_5001() {
		/**
		 *ajax获取相应的数据 专利申请趋势
		 */
		dataX = [];
	  	valueY = [];
	  	comment = [];
		$.ajax({
		type : 'GET',
		url : '/draw/graph/5001',
		//data : jsonda,
		cache: false,
		async:false,
		//contentType: "application/json; charset=utf-8",
		dataType : 'json',
		success : function(res) {
			valueY = res.yValue;
			dataX = res.xAxis;
			comment = res.comment;
		},
		error : function(xml, err, throwInfo) {
			alert(err);
		}
		});
		myChart.clear();
		//alert(comment);
		var symbolSize = 20;
		option = {
   		 title: {
       		 text: '专利申请趋势'
   		 },
   		 tooltip: {
        		trigger: 'axis'
   		 },
   		color: ['#3398DB','#32cd32','#da70d6','#ff6666','#6495ed',
   			'#ff69b4','#ba55d3','#cd5c5c','#ffa500','#40e0d0',       
   			'#1e90ff','#ff6347','#7b68ee','#00fa9a','#ffd700',          
   			'#6699FF','#87cefa','#3cb371','#b8860b','#30e0e0'],
   		dataZoom: [
            {
                show: true,
                //yAxisIndex: 0,
                start: 0,
                end: 100,
                handleIcon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z',
                handleStyle: {
                   color: '#fff',
                   shadowBlur: 3,
                   shadowColor: 'rgba(0, 0, 0, 0.6)',
                   shadowOffsetX: 2,
                   shadowOffsetY: 2
                   }
                
            },
            {
                type: 'inside',
                start: 0,
                end: 100
            },
            ],
            grid: {
            top: '12%',
            left: '1%',
            right: '10%',
            containLabel: true
        },
   		 toolbox: {
       		 feature: {
           	 	saveAsImage: {}
        		}
  		  },
  		  xAxis: {
       		  type: 'category',
       		  boundaryGap: false,
       		  name:'申请年',
       		  nameLocation:'middle',
      		  nameGap: 20,
      		  data: dataX
   		 },
   		 yAxis: {
      		  type: 'value',
       		  name:'专利申请量(件)',
       		  nameLocation:'middle',
       		  nameGap: 40
  		  },
   		 series: [
      		  {
          	  name:'专利申请量(件)',
         	  type:'line',
          	  symbolSize: symbolSize,
          	  data: valueY
        }
    ],
    
};
		 myChart.setOption(option);
	}

	function drawGraph_5002() {
		/**
		 *ajax获取相应的数据 专利授权趋势
		 */
		dataX = [];
	  	valueY = [];
		//文字描述
	  	comment = [];
		//文字描述
		$.ajax({
		type : 'GET',
		url : '/draw/graph/5002',
		//data : jsonda,
		cache: false,
		async:false,
		//contentType: "application/json; charset=utf-8",
		dataType : 'json',
		success : function(res) {
			valueY = res.yValue;
			dataX = res.xAxis;
			//文字描述
			comment = res.comment;
			//文字描述
		},
		error : function(xml, err, throwInfo) {
			alert(err);
		}
		});
		myChart.clear();
		//alert(comment);
		var symbolSize = 20;
		option = {
   		 title: {
       		 text: '专利授权趋势'
   		 },
   		 tooltip: {
        		trigger: 'axis'
   		 },
   		color: ['#3398DB','#32cd32','#da70d6','#ff6666','#6495ed',
   			'#ff69b4','#ba55d3','#cd5c5c','#ffa500','#40e0d0',       
   			'#1e90ff','#ff6347','#7b68ee','#00fa9a','#ffd700',          
   			'#6699FF','#87cefa','#3cb371','#b8860b','#30e0e0'],
   		dataZoom: [
            {
                show: true,
                //yAxisIndex: 0,
                start: 0,
                end: 100,
                handleIcon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z',
                handleStyle: {
                   color: '#fff',
                   shadowBlur: 3,
                   shadowColor: 'rgba(0, 0, 0, 0.6)',
                   shadowOffsetX: 2,
                   shadowOffsetY: 2
                   }
                
            },
            {
                type: 'inside',
                start: 0,
                end: 100
            },
            ],
            grid: {
            top: '12%',
            left: '1%',
            right: '10%',
            containLabel: true
        },
   		 toolbox: {
       		 feature: {
           	 	saveAsImage: {}
        		}
  		  },
  		  xAxis: {
       		  type: 'category',
       		  boundaryGap: false,
       		  name:'申请年',
       		  nameLocation:'middle',
      		  nameGap: 20,
      		  data: dataX
   		 },
   		 yAxis: {
      		  type: 'value',
       		  name:'专利授权量(件)',
       		  nameLocation:'middle',
       		  nameGap: 40
  		  },
   		 series: [
      		  {
          	  name:'专利授权量(件)',
         	  type:'line',
          	  symbolSize: symbolSize,
          	  data: valueY
        }
    ]
};
		 myChart.setOption(option);
	}
	
	function drawGraph_5003() {
		/**
		 *ajax获取相应的数据 申请/授权
		 */
		dataX = [];
	  	valueY1 = [];
	  	valueY2 = [];
		$.ajax({
		type : 'GET',
		url : '/draw/graph/5003',
		//data : jsonda,
		cache: false,
		async:false,
		//contentType: "application/json; charset=utf-8",
		dataType : 'json',
		success : function(res) {
		    valueY1 = res.yapply;
			valueY2 = res.ygrant;
			dataX = res.xAxis;
		},
		error : function(xml, err, throwInfo) {
			alert(err);
		}
		});
		myChart.clear();
		
option = {
    title: {
        text: '申请/授权'
    },
    tooltip : {
        trigger: 'axis',
        axisPointer: {
            type: 'cross',
            label: {
                backgroundColor: '#6a7985'
            }
        }
    },
    legend: {
        data:['专利申请量','专利授权量']
    },
    toolbox: {
        feature: {
            saveAsImage: {}
        }
    },
    color: ['#3398DB','#32cd32','#da70d6','#ff6666','#6495ed',
    	'#ff69b4','#ba55d3','#cd5c5c','#ffa500','#40e0d0',       
    	'#1e90ff','#ff6347','#7b68ee','#00fa9a','#ffd700',          
    	'#6699FF','#87cefa','#3cb371','#b8860b','#30e0e0'],
		dataZoom: [
        {
            show: true,
            //yAxisIndex: 0,
            start: 0,
            end: 100,
            handleIcon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z',
            handleStyle: {
               color: '#fff',
               shadowBlur: 3,
               shadowColor: 'rgba(0, 0, 0, 0.6)',
               shadowOffsetX: 2,
               shadowOffsetY: 2
               }
            
        },
        {
            type: 'inside',
            start: 0,
            end: 100
        },
        ],
        grid: {
        top: '12%',
        left: '1%',
        right: '10%',
        containLabel: true
    },
    xAxis : [
        {
            type : 'category',
            name:'申请年',
       		nameLocation:'middle',
      		nameGap: 20,
            boundaryGap : false,
            data : dataX
        }
    ],
    yAxis : [
        {
            type : 'value',
            name:'专利申请/授权量(件)',
       		nameLocation:'middle',
      		nameGap: 50
        }
    ],
    series : [
        {
            name:'专利申请量',
            type:'line',
            areaStyle: {normal: {}},
            data:valueY1
        },
        {
            name:'专利授权量',
            type:'line',
            stack: '总量',
            areaStyle: {normal: {}},
            data:valueY2
        }
    ]
};
		 myChart.setOption(option);
	}	
	
	function drawGraph_5004() {
		/**
		 *ajax获取相应的数据 专利申请类型
		 */
		dataX = [];
	  	valueY1 = [];
	  	valueY2 = [];
	  	valueY3 = [];
		$.ajax({
		type : 'GET',
		url : '/draw/graph/5004',
		//data : jsonda,
		cache: false,
		async:false,
		//contentType: "application/json; charset=utf-8",
		dataType : 'json',
		success : function(res) {
		    valueY1 = res.graph_5004_y_fmzl;
			valueY2 = res.graph_5004_y_syxxzl;
			valueY3 = res.graph_5004_y_wgsjzl;
			dataX = res.xAxis;
		},
		error : function(xml, err, throwInfo) {
			alert(err);
		}
		});
		myChart.clear();
		
		var sum1=0,sum2=0,sum3=0;
		for(var i=0;i<dataX.length;i++){ 
			sum1 += parseInt(valueY1[i]); 
		} 
		for(var j=0;j<dataX.length;j++){ 
			sum2 += parseInt(valueY2[j]); 
		}
		for(var k=0;k<dataX.length;k++){ 
			sum3 += parseInt(valueY3[k]); 
		}	

option = {
    title: {
        text: '专利申请类型'
    },
    tooltip : {
        trigger: 'axis'
    },
    toolbox: {
        show : true,
        y: 'bottom',
        feature : {
            mark : {show: true},
            dataView : {show: true, readOnly: false},
            magicType : {show: true, type: ['bar', 'stack', 'tiled']},
            restore : {show: true},
            saveAsImage : {show: true}
        }
    },
    calculable : true,
    legend: {
        data:['发明专利','实用新型专利','外观设计专利']
    },
    xAxis : [
        {
            type : 'category',
            name:'申请年',
       		nameLocation:'middle',
      		nameGap: 25,
            splitLine : {show : false},
            data : dataX
        }
    ],
    yAxis : [
        {
            type : 'value',
            position: 'left',
            name:'专利申请量(件)',
       		nameLocation:'middle',
      		nameGap: 43
        }
    ],
    series : [
        {
            name:'发明专利',
            type:'bar',
            stack: '专利',
            data:valueY1
        },
        {
            name:'实用新型专利',
            type:'bar',
            tooltip : {trigger: 'item'},
            stack: '专利',
            data:valueY2
        },
        {
            name:'外观设计专利',
            type:'bar',
            tooltip : {trigger: 'item'},
            stack: '专利',
            data:valueY3
        },
     
   

        {
            name:'专利总数',
            
            type:'pie',
            tooltip : {
                trigger: 'item',
                formatter: '{a} <br/>{b} : {c} ({d}%)'
                
            },
            center: ['40%', '30%'],
            radius : [20, 40],
            itemStyle :　{
                normal : {
                    label:{ 
                                   show: true, 
                                   formatter: '{b} : {c} ({d}%)' 
                                }, 
                                labelLine :{show:true}
                }
            },
            data:[
                {value:sum1, name:'发明专利'},
                {value:sum2, name:'实用新型专利'},
                {value:sum3, name:'外观设计专利'}
                
            ]
        }
    ]
};
	myChart.setOption(option);
		 
	}


	function drawGraph_5005() {
		/**
		 *ajax获取相应的数据 专利法律状态
		 */
		dataX = [];
	  	valueY1 = [];
	  	valueY2 = [];
	  	valueY3 = [];
		$.ajax({
		type : 'GET',
		url : '/draw/graph/5005',
		//data : jsonda,
		cache: false,
		async:false,
		//contentType: "application/json; charset=utf-8",
		dataType : 'json',
		success : function(res) {
		    valueY1 = res.graph_5005_y_yxzl;
			valueY2 = res.graph_5005_y_wxzl;
			valueY3 = res.graph_5005_y_sczdzl;
			dataX = res.xAxis;
		},
		error : function(xml, err, throwInfo) {
			alert(err);
		}
		});
		myChart.clear();
		
		var sum1=0,sum2=0,sum3=0;
		for(var i=0;i<dataX.length;i++){ 
			sum1 += parseInt(valueY1[i]); 
		} 
		for(var j=0;j<dataX.length;j++){ 
			sum2 += parseInt(valueY2[j]); 
		}
		for(var k=0;k<dataX.length;k++){ 
			sum3 += parseInt(valueY3[k]); 
		}	
		
		

option = {
	/**
	 * 鼠标移动到图形区域显示数据
	 */
	tooltip : {
        trigger: 'axis',
        axisPointer : {           
            type : 'shadow'       
        }
    },
    title: {
        text: '专利法律状态',
        x: 'center',
        y: 0
    },
    toolbox: {
        show : true,
        y: 'bottom',
        feature : {
            saveAsImage : {show: true}
        }
    },
    legend: {
    right:20,
        data:['有效的专利','无效的专利','审查中的专利']
    },
    grid: [
        {x: '7%', y: '7%', width: '87%', height: '38%'},
        {x: '7%', y: '57%', width: '87%', height: '38%'}

       
    ],

    xAxis: [
        {gridIndex: 0, data: dataX},
        {gridIndex: 1, data: ['有效的专利','无效的专利','审查中的专利']}
  
      
    ],
    yAxis: [
        {gridIndex: 0, type : 'value',position: 'left',
        	name:'专利申请量(件)',
       		nameLocation:'middle',
      		nameGap: 43},
        {gridIndex: 1, type : 'value',position: 'left',
      			name:'专利申请量(件)',
           		nameLocation:'middle',
          		nameGap: 43}
     
    
    ],
    series: [
               
        {
            name:'有效的专利',
            type:'bar',
            xAxisIndex: 0,
            yAxisIndex: 0,
            tooltip : {trigger: 'item'},
            stack: '专利',
            data:valueY1
        },
        {
            name:'无效的专利',
            type:'bar',
            xAxisIndex: 0,
            yAxisIndex: 0,
            tooltip : {trigger: 'item'},
            stack: '专利',
            data:valueY2
        },
        {
            name:'审查中的专利',
            type:'bar',
            xAxisIndex: 0,
            yAxisIndex: 0,
            tooltip : {trigger: 'item'},
            stack: '专利',
            data:valueY3
        },
        
        {
            name:'专利数量/件',
            type:'bar',
            xAxisIndex: 1,
            yAxisIndex: 1, 
            label: {
                normal: {
                    show: true,
                    position: 'top'
                }
            },
            data:[sum1,sum2,sum3]
        }
        
        

    ]
};
	myChart.setOption(option);
		 
	}

	function drawGraph_5006() {
		/**
		 *ajax获取相应的数据 排名前20企业/研发机构
		 */
		dataX = [];
	  	valueY1 = [];
	  	valueY2 = [];
	  	valueY3 = [];
		$.ajax({
		type : 'GET',
		url : '/draw/graph/5006',
		//data : jsonda,
		cache: false,
		async:false,
		//contentType: "application/json; charset=utf-8",
		dataType : 'json',
		success : function(res) {
		    valueY1 = res.graph_5006_y_value;
			valueY2 = 0;
			valueY3 = 0;
			dataX = res.xAxis;
		},
		error : function(xml, err, throwInfo) {
			alert(err);
		}
		});
		myChart.clear();
	
		

option = {
        title: {
        text: '排名前20企业/研发机构',
        x: 'center',
        y: 0
    },
    tooltip : {
        trigger: 'axis',
        axisPointer : {            // 坐标轴指示器，坐标轴触发有效
            type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
        }
    },
    toolbox: {
        show : true,
        y: 'bottom',
        feature : {
            saveAsImage : {show: true}
        }
    },
    grid: {
        left: '3%',
        right: '4%',
        bottom: '3%',
        containLabel: true
    },
    xAxis:  {
    	name:'专利申请量(件)',
       	nameLocation:'middle',
      	nameGap: 20,
        type: 'value'
        
    },
    yAxis: {
        type: 'category',
        data: dataX, 
        axisLabel: {
        	 textStyle: {fontSize: 12},
 interval: 0,  
   formatter: function (name) {
    return (name.length > 8 ? (name.slice(0,8)+"...") : name ); 
}
 
 
}

    },
    series: [
        
        {
            name: '专利申请量(件)',
            type: 'bar',
            stack: '总量',
            label: {
                normal: {
                    show: true,
                    position: 'insideRight'
                }
            },
            data: valueY1
        }
    ]
};
	myChart.setOption(option);
	//window.onresize = myChart.resize;
		 
	}
	
	
	function drawGraph_5007() {
		/**
		 *ajax获取相应的数据 排名前10企业年度申请
		 */
		dataX = [];
	  	valueY1 = [];
	  	valueY2 = [];
	  	valueY3 = [];
	    valueY4 = [];
	  	valueY5 = [];
	  	valueY6 = [];
	  	valueY7 = [];
	    valueY8 = [];
	  	valueY9 = [];
	  	valueY10 = [];
	  	valueYCname = [];
		$.ajax({
		type : 'GET',
		url : '/draw/graph/5007',
		//data : jsonda,
		cache: false,
		async:false,
		//contentType: "application/json; charset=utf-8",
		dataType : 'json',
		success : function(res) {
			valueY1 = res.graph_5007_y_company1;
	  		valueY2 = res.graph_5007_y_company2;
	  		valueY3 = res.graph_5007_y_company3;
	   		valueY4 = res.graph_5007_y_company4;
	  		valueY5 = res.graph_5007_y_company5;
	  		valueY6 = res.graph_5007_y_company6;
	  		valueY7 = res.graph_5007_y_company7;
	  	 	valueY8 = res.graph_5007_y_company8;
	  		valueY9 = res.graph_5007_y_company9;
	  		valueY10 = res.graph_5007_y_company10;
	  		valueYCname = res.graph_5007_y_companyname;
			dataX = res.xAxis;
		},
		error : function(xml, err, throwInfo) {
			alert(err);
		}
		});
		myChart.clear();
	
		

option = {
    title: {
        text: '排名前10企业年度申请'
    },
    tooltip: {
        trigger: 'axis'
    },
    legend: {
        data:valueYCname,
        top:'10%',
        left:'10%',
        orient: 'vertical'
    },
    grid: {
        left: '3%',
        right: '4%',
        bottom: '3%',
        containLabel: true
    },
    toolbox: {
        feature: {
            saveAsImage: {}
        }
    },
    xAxis: {
        type: 'category',
        boundaryGap: false,
        data: dataX,
        name:'申请年',
   		nameLocation:'middle',
  		nameGap: 20
    },
    yAxis: {
        type: 'value',
        name:'专利申请量(件)',
       	nameLocation:'middle',
      	nameGap: 25
    },
    series: [
        {
            name:valueYCname[0],
            type:'line',
            data:valueY1
        },
        {
            name:valueYCname[1],
            type:'line',
            data:valueY2
        },
        {
            name:valueYCname[2],
            type:'line',
            data:valueY3
        },
        {
            name:valueYCname[3],
            type:'line',
            data:valueY4
        },
        {
            name:valueYCname[4],
            type:'line',
            data:valueY5
        },
        {
            name:valueYCname[5],
            type:'line',
            data:valueY6
        },
        {
            name:valueYCname[6],
            type:'line',
            data:valueY7
        },
        {
            name:valueYCname[7],
            type:'line',
            data:valueY8
        },
        {
            name:valueYCname[8],
            type:'line',
            data:valueY9
        },
        {
            name:valueYCname[9],
            type:'line',
            data:valueY10
        }
    ]
};

	myChart.setOption(option);
		 
	}
	
	
	function drawGraph_5008() {
		/**
		 *ajax获取相应的数据 排名前10企业专利类型
		 */
		dataX = [];
	  	valueY1 = [];
	  	valueY2 = [];
	  	valueY3 = [];
		$.ajax({
		type : 'GET',
		url : '/draw/graph/5008',
		//data : jsonda,
		cache: false,
		async:false,
		//contentType: "application/json; charset=utf-8",
		dataType : 'json',
		success : function(res) {
		    valueY1 = res.graph_5008_y_fmzl;
			valueY2 = res.graph_5008_y_syxxzl;
			valueY3 = res.graph_5008_y_wgsjzl;
			dataX = res.xAxis;
		},
		error : function(xml, err, throwInfo) {
			alert(err);
		}
		});
		myChart.clear();
		
		var sum1=0,sum2=0,sum3=0;
		for(var i=0;i<dataX.length;i++){ 
			sum1 += parseInt(valueY1[i]); 
		} 
		for(var j=0;j<dataX.length;j++){ 
			sum2 += parseInt(valueY2[j]); 
		}
		for(var k=0;k<dataX.length;k++){ 
			sum3 += parseInt(valueY3[k]); 
		}	
		

option = {
    title: {
        text: '排名前10企业专利类型'
    },
    tooltip : {
        trigger: 'axis'
    },
    toolbox: {
        show : true,
        y: 'bottom',
        feature : {
            mark : {show: true},
            dataView : {show: true, readOnly: false},
            magicType : {show: true, type: ['bar', 'stack', 'tiled']},
            restore : {show: true},
            saveAsImage : {show: true}
        }
    },
    calculable : true,
    legend: {
        data:['发明专利','实用新型专利','外观设计专利']
    },
    xAxis : [
        {
            type : 'category',
            name:'前十企业',
       		nameLocation:'middle',
      		nameGap: 39,
            splitLine : {show : false},
            data : dataX,
          axisLabel:{  
            interval:0,//横轴信息全部显示  
            rotate:-30//-30度角倾斜显示  
          }  
        }
    ],
    grid: {  
       y2: 160
   },  
    yAxis : [
        {
            type : 'value',
            position: 'left',
            name:'专利申请量(件)',
       		nameLocation:'middle',
      		nameGap: 25
        }
    ],
    series : [
        {
            name:'发明专利',
            type:'bar',
            stack: '专利',
            data:valueY1
        },
        {
            name:'实用新型专利',
            type:'bar',
            tooltip : {trigger: 'item'},
            stack: '专利',
            data:valueY2
        },
        {
            name:'外观设计专利',
            type:'bar',
            tooltip : {trigger: 'item'},
            stack: '专利',
            data:valueY3
        }
     
    ]
};
	myChart.setOption(option);
		 
	}
	
	function drawGraph_5009() {
		/**
		 *ajax获取相应的数据 排名前10企业专利类型
		 */
		dataX = [];
	  	valueY1 = [];
	  	valueY2 = [];
	  	valueY3 = [];
	  	valueY4 = [];
	  	valueY5 = [];
		$.ajax({
		type : 'GET',
		url : '/draw/graph/5009',
		//data : jsonda,
		cache: false,
		async:false,
		//contentType: "application/json; charset=utf-8",
		dataType : 'json',
		success : function(res) {
		    valueY1 = res.graph_5009_y_America;
			valueY2 = res.graph_5009_y_Japan;
			valueY3 = res.graph_5009_y_Europe;
			valueY4 = res.graph_5009_y_Korea;
			valueY5 = res.graph_5009_y_China;
			dataX = res.xAxis;
		},
		error : function(xml, err, throwInfo) {
			alert(err);
		}
		});
		myChart.clear();
		
		var sum1=0,sum2=0,sum3=0;
		for(var i=0;i<dataX.length;i++){ 
			sum1 += parseInt(valueY1[i]); 
		} 
		for(var j=0;j<dataX.length;j++){ 
			sum2 += parseInt(valueY2[j]); 
		}
		for(var k=0;k<dataX.length;k++){ 
			sum3 += parseInt(valueY3[k]); 
		}


option = {
    title: {
        text: '5大技术国高价值专利占比'
    },
    tooltip : {
        trigger: 'axis'
    },
    toolbox: {
        show : true,
        y: 'bottom',
        feature : {
            mark : {show: true},
            dataView : {show: true, readOnly: false},
            magicType : {show: true, type: ['bar', 'stack', 'tiled']},
            restore : {show: true},
            saveAsImage : {show: true}
        }
    },
    calculable : true,
    legend: {
        data:['美国','日本','欧洲','韩国','中国']
    },
    xAxis : [
        {
            type : 'category',
            name:'申请年',
       		nameLocation:'middle',
      		nameGap: 25,
            splitLine : {show : false},
            data : dataX
        }
    ],
    yAxis : [
        {
            type : 'value',
            axisLabel: {  
                  show: true,  
                  interval: 'auto',  
                  formatter: '{value} %'  
                },  
            show: true,
            position: 'left',
            name:'高价值专利占比',
       		nameLocation:'middle',
      		nameGap: 45,
      		max:100,
      		min:0
        }
    ],
    series : [
        {
            name:'美国',
            type:'bar',
            stack: '专利',
            data:valueY1
        },
        {
            name:'日本',
            type:'bar',
            tooltip : {trigger: 'item'},
            stack: '专利',
            data:valueY2
        },
        {
            name:'欧洲',
            type:'bar',
            tooltip : {trigger: 'item'},
            stack: '专利',
            data:valueY3
        },
        {
            name:'韩国',
            type:'bar',
            tooltip : {trigger: 'item'},
            stack: '专利',
            data:valueY4
        },
        {
            name:'中国',
            type:'bar',
            tooltip : {trigger: 'item'},
            stack: '专利',
            data:valueY5
        }
      
    ]
};
	myChart.setOption(option);
		 
	}
	
	function drawGraph_5010() {
		/**
		 *ajax获取相应的数据 技术分支高价值专利国家分布
		 */
		dataX = [];
	  	valueY1 = [];
	  	valueY2 = [];
	  	valueY3 = [];
	  	valueY4 = [];
	  	valueY5 = [];
		$.ajax({
		type : 'GET',
		url : '/draw/graph/5010',
		//data : jsonda,
		cache: false,
		async:false,
		//contentType: "application/json; charset=utf-8",
		dataType : 'json',
		success : function(res) {
		    valueY1 = res.graph_5010_y_America;
			valueY2 = res.graph_5010_y_Japan;
			valueY3 = res.graph_5010_y_Europe;
			valueY4 = res.graph_5010_y_Korea;
			valueY5 = res.graph_5010_y_China;
			dataX = res.xAxis;
		},
		error : function(xml, err, throwInfo) {
			alert(err);
		}
		});
		myChart.clear();



option = {
    title: {
        text: '专利技术价值分布'
    },
    tooltip : {
        trigger: 'axis'
    },
    toolbox: {
        show : true,
        y: 'bottom',
        feature : {
            mark : {show: true},
            dataView : {show: true, readOnly: false},
            magicType : {show: true, type: ['bar', 'stack', 'tiled']},
            restore : {show: true},
            saveAsImage : {show: true}
        }
    },
    calculable : true,
    legend: {
        data:['美国','日本','欧洲','韩国','中国']
    },
    xAxis : [
        {
            type : 'category',
            name:'申请年',
       		nameLocation:'middle',
      		nameGap: 25,
            splitLine : {show : false},
            data : dataX
        }
    ],
    yAxis : [
        {
            type : 'value',
            axisLabel: {  
                  show: true,  
                  interval: 'auto',  
                  formatter: '{value} %'  
                },  
            show: true,
            position: 'left',
            name:'高价值专利占比',
       		nameLocation:'middle',
      		nameGap: 45,
      		max:100,
      		min:0
        }
    ],
    series : [
        {
            name:'美国',
            type:'bar',
            stack: '专利',
            data:valueY1
        },
        {
            name:'日本',
            type:'bar',
            tooltip : {trigger: 'item'},
            stack: '专利',
            data:valueY2
        },
        {
            name:'欧洲',
            type:'bar',
            tooltip : {trigger: 'item'},
            stack: '专利',
            data:valueY3
        },
        {
            name:'韩国',
            type:'bar',
            tooltip : {trigger: 'item'},
            stack: '专利',
            data:valueY4
        },
        {
            name:'中国',
            type:'bar',
            tooltip : {trigger: 'item'},
            stack: '专利',
            data:valueY5
        }
      
    ]
};
	myChart.setOption(option);
		 
	}
	
	function drawGraph_5011() {
		/**
		 *ajax获取相应的数据 技术分支高价值专利国家分布
		 */
		dataX = [];
	  	valueY1 = [];
	  	valueY2 = [];
	  	valueY3 = [];
	  	valueY4 = [];
	  	valueY5 = [];
	  	valueY6 = [];
	  	valueY7 = [];
	  	valueY8 = [];
	  	
	  	valueY12 = [];
	  	valueY22 = [];
	  	valueY32 = [];
	  	valueY42 = [];
	  	valueY52 = [];
		$.ajax({
		type : 'GET',
		url : '/draw/graph/5011',
		//data : jsonda,
		cache: false,
		async:false,
		//contentType: "application/json; charset=utf-8",
		dataType : 'json',
		success : function(res) {
			valueY1 = res.graph_5011_y_tech1
			valueY2 = res.graph_5011_y_tech2
			valueY3 = res.graph_5011_y_tech3
			valueY4 = res.graph_5011_y_tech4
			valueY5 = res.graph_5011_y_tech5
			valueY6 = res.graph_5011_y_tech6
			valueY7 = res.graph_5011_y_tech7
			valueY8 = res.graph_5011_y_tech8
			dataX = res.xAxis;
			
			valueY12 = res.graph_5011_y_1;
	     	valueY22 = res.graph_5011_y_2;
	    	valueY32 = res.graph_5011_y_3;
	  	    valueY42 = res.graph_5011_y_4;
	  	    valueY52 = res.graph_5011_y_5;
		},
		error : function(xml, err, throwInfo) {
			alert(err);
		}
		});
		myChart.clear();
		
		dataX2 = ['C01B31/04','H01M4/36','C01B32/184','B01J20/20','H01G11/86','C01B31/02','C09D163/00','G01N27/30'];
	  	




option = {
    title: {
        text: '技术分支高价值专利国家分布',
        x: 'center',
        y: 0
    },
    tooltip : {
        trigger: 'axis'
    },
    toolbox: {
        show : true,
        y: 'bottom',
        feature : {
            saveAsImage : {show: true}
        }
    },
    calculable : true,
    legend: {
        data:['C01B31/04','H01M4/36','C01B32/184','B01J20/20','H01G11/86','C01B31/02','C09D163/00','G01N27/30']
    },
    grid: [
        {x: '7%', y: '7%', width: '87%', height: '38%'},
        {x: '7%', y: '57%', width: '87%', height: '38%'}     
    ],
    xAxis : [
        {   gridIndex: 0,
            type : 'category',
            //name:'国家',
       		nameLocation:'middle',
      		nameGap: 25,
            splitLine : {show : false},
            data : dataX
        },
        {gridIndex: 1, data: dataX2}
    ],
    yAxis : [
        {   gridIndex: 0,
            type : 'value',
            axisLabel: {  
                  show: true,  
                  interval: 'auto'
                  //formatter: '{value} %'  
                },  
            show: true,
            position: 'left',
            name:'高价值专利数量(件)',
       		nameLocation:'middle',
      		nameGap: 45

        },
        {gridIndex: 1, type : 'value',position: 'left',
        	name:'高价值专利数量(件)',
       		nameLocation:'middle',
      		nameGap: 45}
    ],
    series : [
        {
            //name:'美国',
            type:'bar',
            xAxisIndex: 0,
            yAxisIndex: 0,
            stack: '专利',
            data:valueY1
        },
        {
            //name:'日本',
            type:'bar',
            xAxisIndex: 0,
            yAxisIndex: 0,
            tooltip : {trigger: 'item'},
            stack: '专利',
            data:valueY2
        },
        {
            //name:'欧洲',
            type:'bar',
            xAxisIndex: 0,
            yAxisIndex: 0,
            tooltip : {trigger: 'item'},
            stack: '专利',
            data:valueY3
        },
        {
            //name:'韩国',
            type:'bar',
            xAxisIndex: 0,
            yAxisIndex: 0,
            tooltip : {trigger: 'item'},
            stack: '专利',
            data:valueY4
        },
        {
            //name:'中国',
            type:'bar',
            xAxisIndex: 0,
            yAxisIndex: 0,
            tooltip : {trigger: 'item'},
            stack: '专利',
            data:valueY5
        },
        {
            //name:'中国',
            type:'bar',
            xAxisIndex: 0,
            yAxisIndex: 0,
            tooltip : {trigger: 'item'},
            stack: '专利',
            data:valueY6
        },
        {
            //name:'中国',
            type:'bar',
            xAxisIndex: 0,
            yAxisIndex: 0,
            tooltip : {trigger: 'item'},
            stack: '专利',
            data:valueY7
        },
        {
            //name:'中国',
            type:'bar',
            xAxisIndex: 0,
            yAxisIndex: 0,
            tooltip : {trigger: 'item'},
            stack: '专利',
            data:valueY8
        },
       
        //transposition
        {
            //name:'美国',
            type:'bar',
            xAxisIndex: 1,
            yAxisIndex: 1,
            stack: 'tran',
            data:valueY12
        },
        {
            //name:'日本',
            type:'bar',
            xAxisIndex: 1,
            yAxisIndex: 1,
            tooltip : {trigger: 'item'},
            stack: 'tran',
            data:valueY22
        },
        {
            //name:'欧洲',
            type:'bar',
            xAxisIndex: 1,
            yAxisIndex: 1,
            tooltip : {trigger: 'item'},
            stack: 'tran',
            data:valueY32
        },
        {
            //name:'韩国',
            type:'bar',
            xAxisIndex: 1,
            yAxisIndex: 1,
            tooltip : {trigger: 'item'},
            stack: 'tran',
            data:valueY42
        },
        {
            //name:'中国',
            type:'bar',
            xAxisIndex: 1,
            yAxisIndex: 1,
            tooltip : {trigger: 'item'},
            stack: 'tran',
            data:valueY52
        }
      
    ]
};
	myChart.setOption(option);
		 
	}
	
	function drawGraph_5012() {
		/**
		 *ajax获取相应的数据 技术分支高价值专利国家分布
		 */
		dataX = [];
	  	valueY1 = [];
	  	valueY2 = [];
	  	valueY3 = [];
	  	valueY4 = [];
	  	valueY5 = [];
	  	valueY6 = [];
	  	valueY7 = [];
	  	valueY8 = [];
	  	axisX_show = [];
	  	
	  	valueY12 = [];
	  	valueY22 = [];
	  	valueY32 = [];
	  	valueY42 = [];
	  	valueY52 = [];
		$.ajax({
		type : 'GET',
		url : '/draw/graph/5012',
		//data : jsonda,
		cache: false,
		async:false,
		//contentType: "application/json; charset=utf-8",
		dataType : 'json',
		success : function(res) {
			valueY1 = res.graph_5012_y_tech1
			valueY2 = res.graph_5012_y_tech2
			valueY3 = res.graph_5012_y_tech3
			valueY4 = res.graph_5012_y_tech4
			valueY5 = res.graph_5012_y_tech5
			valueY6 = res.graph_5012_y_tech6
			valueY7 = res.graph_5012_y_tech7
			valueY8 = res.graph_5012_y_tech8
			dataX = res.xAxis;
			axisX_show = res.axisX_show;
			
			valueY12 = res.graph_5012_y_1;
	     	valueY22 = res.graph_5012_y_2;
	    	valueY32 = res.graph_5012_y_3;
	  	    valueY42 = res.graph_5012_y_4;
	  	    valueY52 = res.graph_5012_y_5;
		},
		error : function(xml, err, throwInfo) {
			alert(err);
		}
		});
		myChart.clear();
		
		dataX2 = ['C01B31/04','H01M4/36','C01B32/184','B01J20/20','H01G11/86','C01B31/02','C09D163/00','G01N27/30'];
	  	




option = {
    title: {
        text: '技术分支高价值专利企业',
        x: 'center',
        y: 0
    },
    tooltip : {
        trigger: 'axis'
    },
    toolbox: {
        show : true,
        y: 'bottom',
        feature : {
            saveAsImage : {show: true}
        }
    },
    calculable : true,
    legend: {
        data:['C01B31/04','H01M4/36','C01B32/184','B01J20/20','H01G11/86','C01B31/02','C09D163/00','G01N27/30']
    },
    grid: [
        {x: '7%', y: '7%', width: '87%', height: '38%'},
        {x: '7%', y: '57%', width: '87%', height: '38%'}     
    ],
    xAxis : [
        {   gridIndex: 0,
            type : 'category',
            //name:'国家',
       		nameLocation:'middle',
      		nameGap: 25,
            splitLine : {show : false},
            data : axisX_show,
          axisLabel:{  
            interval:0,//横轴信息全部显示  
            //rotate:-30,//-30度角倾斜显示  
            formatter: function (name) {
    return (name.length > 4 ? (name.slice(0,4)+"...") : name ); 
}
       }  
        },
 
        {gridIndex: 1, data: dataX2}
    ],
    yAxis : [
        {   gridIndex: 0,
            type : 'value',
            axisLabel: {  
                  show: true,  
                  interval: 'auto'
                  //formatter: '{value} %'  
                },  
            show: true,
            position: 'left',
            name:'高价值专利数量/件',
       		nameLocation:'middle',
      		nameGap: 45

        },
        {gridIndex: 1, type : 'value',position: 'left',
        	name:'高价值专利数量(件)',
       		nameLocation:'middle',
      		nameGap: 45}
    ],
    series : [
        {
            //name:'美国',
            type:'bar',
            xAxisIndex: 0,
            yAxisIndex: 0,
            stack: '专利',
            data:valueY1
        },
        {
            //name:'日本',
            type:'bar',
            xAxisIndex: 0,
            yAxisIndex: 0,
            tooltip : {trigger: 'item'},
            stack: '专利',
            data:valueY2
        },
        {
            //name:'欧洲',
            type:'bar',
            xAxisIndex: 0,
            yAxisIndex: 0,
            tooltip : {trigger: 'item'},
            stack: '专利',
            data:valueY3
        },
        {
            //name:'韩国',
            type:'bar',
            xAxisIndex: 0,
            yAxisIndex: 0,
            tooltip : {trigger: 'item'},
            stack: '专利',
            data:valueY4
        },
        {
            //name:'中国',
            type:'bar',
            xAxisIndex: 0,
            yAxisIndex: 0,
            tooltip : {trigger: 'item'},
            stack: '专利',
            data:valueY5
        },
        {
            //name:'中国',
            type:'bar',
            xAxisIndex: 0,
            yAxisIndex: 0,
            tooltip : {trigger: 'item'},
            stack: '专利',
            data:valueY6
        },
        {
            //name:'中国',
            type:'bar',
            xAxisIndex: 0,
            yAxisIndex: 0,
            tooltip : {trigger: 'item'},
            stack: '专利',
            data:valueY7
        },
        {
            //name:'中国',
            type:'bar',
            xAxisIndex: 0,
            yAxisIndex: 0,
            tooltip : {trigger: 'item'},
            stack: '专利',
            data:valueY8
        },
       
        //transposition
        {
            //name:'美国',
            type:'bar',
            xAxisIndex: 1,
            yAxisIndex: 1,
            stack: 'tran',
            data:valueY12
        },
        {
            //name:'日本',
            type:'bar',
            xAxisIndex: 1,
            yAxisIndex: 1,
            tooltip : {trigger: 'item'},
            stack: 'tran',
            data:valueY22
        },
        {
            //name:'欧洲',
            type:'bar',
            xAxisIndex: 1,
            yAxisIndex: 1,
            tooltip : {trigger: 'item'},
            stack: 'tran',
            data:valueY32
        },
        {
            //name:'韩国',
            type:'bar',
            xAxisIndex: 1,
            yAxisIndex: 1,
            tooltip : {trigger: 'item'},
            stack: 'tran',
            data:valueY42
        },
        {
            //name:'中国',
            type:'bar',
            xAxisIndex: 1,
            yAxisIndex: 1,
            tooltip : {trigger: 'item'},
            stack: 'tran',
            data:valueY52
        }
      
    ]
};
	myChart.setOption(option);
		 
	}

function drawGraph_500211() {
	myChart.clear();
	var xAxisData = [];
	var data1 = [];
	var data2 = [];
	for (var i = 0; i < 100; i++) {
	    xAxisData.push('类目' + i);
	    data1.push((Math.sin(i / 5) * (i / 5 -10) + i / 6) * 5);
	    data2.push((Math.cos(i / 5) * (i / 5 -10) + i / 6) * 5);
	}
	option = {
		    title : {
		        text: '某站点用户访问来源',
		        subtext: '纯属虚构',
		        x:'center'
		    },
		    tooltip : {
		        trigger: 'item',
		        formatter: "{a} <br/>{b} : {c} ({d}%)"
		    },
		    legend: {
		        orient: 'vertical',
		        left: 'left',
		        data: ['直接访问','邮件营销','联盟广告','视频广告','搜索引擎']
		    },
		    series : [
		        {
		            name: '访问来源',
		            type: 'pie',
		            radius : '55%',
		            center: ['50%', '60%'],
		            data:[
		                {value:335, name:'美国'},
		                {value:310, name:'日本'},
		                {value:234, name:'欧专局'},
		                {value:135, name:'韩国'},
		                {value:135, name:'中国'},
		                {value:1548, name:'其他'}
		            ],
		            itemStyle: {
		                emphasis: {
		                    shadowBlur: 10,
		                    shadowOffsetX: 0,
		                    shadowColor: 'rgba(0, 0, 0, 0.5)'
		                }
		            }
		        }
		    ]
		};
		 myChart.setOption(option);
	}
});